package com.winshare.saleAssistant.domain.dto.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@ApiModel
public class ProductInfoVersionCreateDTO {

    @NotBlank(message = "版本编号不可以为空")
    @Length(min = 1, max = 30, message = "版本编号长度需要在1-30个字之间")
    @ApiModelProperty(value = "版本编号")
    private String versionCode;

    @NotBlank(message = "版本名称不可以为空")
    @Length(min = 1, max = 100, message = "版本名称长度需要在1-100个字之间")
    @ApiModelProperty(value = "版本名称")
    private String versionName;

    @ApiModelProperty(value = "销售定价")
    @DecimalMin(value = "0.01")
    private BigDecimal price;

    @NotNull(message = "定价方式不可以为空")
    @Range(min = 1, max = 2,message = "定价方式:1,按年; 2,买断")
    @ApiModelProperty(value = "定价方式:1,按年; 2,买断")
    private Integer fixPriceType;

    @NotBlank(message = "版本描述不可以为空")
    @Length(min = 1, max = 150, message = "版本描述长度需要在1-150个字之间")
    @ApiModelProperty(value = "版本描述")
    private String description;

    @NotNull(message = "产品信息Id不可以为空")
    @Range(min = 1, message = "产品信息Id为大于或等1的正整数")
    @ApiModelProperty(value = "产品信息Id不可以为空")
    private Integer productInfoId;

    public ProductInfoVersionCreateDTO() {
    }

    public String getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(String versionCode) {
        this.versionCode = versionCode;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getFixPriceType() {
        return fixPriceType;
    }

    public void setFixPriceType(Integer fixPriceType) {
        this.fixPriceType = fixPriceType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getProductInfoId() {
        return productInfoId;
    }

    public void setProductInfoId(Integer productInfoId) {
        this.productInfoId = productInfoId;
    }
}
